package com.yzy.fly.util.asm;

import com.yzy.fly.entity.core.FlyField;
import org.objectweb.asm.*;

import java.io.File;

public class TestDumpNew implements Opcodes {

    public static void main(String[] args) throws Exception {
        String relative_path = "sample/HelloWorld.class";
        String filepath = "D:\\gitee\\vhlSpringCloud\\bi\\target\\classes\\com\\yzy\\bi\\entity\\core\\Test.class";
//        String relative_path = "D:\\gitee\\vhlSpringCloud\\bi\\target\\classes\\com\\yzy\\bi\\entity\\core\\Test.class";
//        String filepath = FileUtils.getFilePath(relative_path);

        // (1) 生成byte[]内容
        byte[] bytes = dump();
        File classFile = new File(filepath);
        if (classFile.exists()) {
            classFile.delete();
        }
        // (2) 保存byte[]到文件
//        FileUtils.writeByteArrayToFile(classFile, bytes);
    }

    public static byte[] dump() throws Exception {

        ClassWriter classWriter = new ClassWriter(0);
        FieldVisitor fieldVisitor;
        RecordComponentVisitor recordComponentVisitor;
        MethodVisitor methodVisitor;
        AnnotationVisitor annotationVisitor0;

        classWriter.visit(V1_8, ACC_PUBLIC | ACC_SUPER, "com/yzy/bi/entity/core/Test", null, "java/lang/Object", new String[]{"java/io/Serializable" });

        {
            annotationVisitor0 = classWriter.visitAnnotation("Lcom/baomidou/mybatisplus/annotation/TableName;", true);
            annotationVisitor0.visit("value", "test");
            annotationVisitor0.visitEnd();
        }
        {
            fieldVisitor = classWriter.visitField(ACC_PRIVATE, "id", "Ljava/lang/Integer;", null, null);
            {
                annotationVisitor0 = fieldVisitor.visitAnnotation("Lcom/baomidou/mybatisplus/annotation/TableId;", true);
                annotationVisitor0.visitEnum("type", "Lcom/baomidou/mybatisplus/annotation/IdType;", "AUTO");
                annotationVisitor0.visitEnd();
            }
            fieldVisitor.visitEnd();
        }
        {
            fieldVisitor = classWriter.visitField(ACC_PRIVATE, "no", "Ljava/lang/String;", null, null);
            fieldVisitor.visitEnd();
        }
        {
            fieldVisitor = classWriter.visitField(ACC_PRIVATE, "print", "Ljava/lang/String;", null, null);
            {
                annotationVisitor0 = fieldVisitor.visitAnnotation("Lcom/baomidou/mybatisplus/annotation/TableField;", true);
                annotationVisitor0.visit("exist", Boolean.FALSE);
                annotationVisitor0.visitEnd();
            }
            fieldVisitor.visitEnd();
        }
        {
            fieldVisitor = classWriter.visitField(ACC_PRIVATE, "parentId", "Ljava/lang/Integer;", null, null);
            fieldVisitor.visitEnd();
        }
        {
            fieldVisitor = classWriter.visitField(ACC_PRIVATE, "configList", "Ljava/util/List;", "Ljava/util/List<Lcom/yzy/bi/entity/core/Test;>;", null);
            {
                annotationVisitor0 = fieldVisitor.visitAnnotation("Lcom/baomidou/mybatisplus/annotation/TableField;", true);
                annotationVisitor0.visit("exist", Boolean.FALSE);
                annotationVisitor0.visitEnd();
            }
            fieldVisitor.visitEnd();
        }
        {
            fieldVisitor = classWriter.visitField(ACC_PRIVATE, "stream", "Lcom/yzy/bi/entity/core/Stream;", null, null);
            {
                annotationVisitor0 = fieldVisitor.visitAnnotation("Lcom/baomidou/mybatisplus/annotation/TableField;", true);
                annotationVisitor0.visit("exist", Boolean.FALSE);
                annotationVisitor0.visitEnd();
            }
            fieldVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
            methodVisitor.visitInsn(RETURN);
            methodVisitor.visitMaxs(1, 1);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "getId", "()Ljava/lang/Integer;", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitFieldInsn(GETFIELD, "com/yzy/bi/entity/core/Test", "id", "Ljava/lang/Integer;");
            methodVisitor.visitInsn(ARETURN);
            methodVisitor.visitMaxs(1, 1);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "getNo", "()Ljava/lang/String;", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitFieldInsn(GETFIELD, "com/yzy/bi/entity/core/Test", "no", "Ljava/lang/String;");
            methodVisitor.visitInsn(ARETURN);
            methodVisitor.visitMaxs(1, 1);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "getPrint", "()Ljava/lang/String;", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitFieldInsn(GETFIELD, "com/yzy/bi/entity/core/Test", "print", "Ljava/lang/String;");
            methodVisitor.visitInsn(ARETURN);
            methodVisitor.visitMaxs(1, 1);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "getParentId", "()Ljava/lang/Integer;", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitFieldInsn(GETFIELD, "com/yzy/bi/entity/core/Test", "parentId", "Ljava/lang/Integer;");
            methodVisitor.visitInsn(ARETURN);
            methodVisitor.visitMaxs(1, 1);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "getConfigList", "()Ljava/util/List;", "()Ljava/util/List<Lcom/yzy/bi/entity/core/Test;>;", null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitFieldInsn(GETFIELD, "com/yzy/bi/entity/core/Test", "configList", "Ljava/util/List;");
            methodVisitor.visitInsn(ARETURN);
            methodVisitor.visitMaxs(1, 1);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "getStream", "()Lcom/yzy/bi/entity/core/Stream;", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitFieldInsn(GETFIELD, "com/yzy/bi/entity/core/Test", "stream", "Lcom/yzy/bi/entity/core/Stream;");
            methodVisitor.visitInsn(ARETURN);
            methodVisitor.visitMaxs(1, 1);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "setId", "(Ljava/lang/Integer;)V", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitFieldInsn(PUTFIELD, "com/yzy/bi/entity/core/Test", "id", "Ljava/lang/Integer;");
            methodVisitor.visitInsn(RETURN);
            methodVisitor.visitMaxs(2, 2);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "setNo", "(Ljava/lang/String;)V", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitFieldInsn(PUTFIELD, "com/yzy/bi/entity/core/Test", "no", "Ljava/lang/String;");
            methodVisitor.visitInsn(RETURN);
            methodVisitor.visitMaxs(2, 2);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "setPrint", "(Ljava/lang/String;)V", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitFieldInsn(PUTFIELD, "com/yzy/bi/entity/core/Test", "print", "Ljava/lang/String;");
            methodVisitor.visitInsn(RETURN);
            methodVisitor.visitMaxs(2, 2);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "setParentId", "(Ljava/lang/Integer;)V", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitFieldInsn(PUTFIELD, "com/yzy/bi/entity/core/Test", "parentId", "Ljava/lang/Integer;");
            methodVisitor.visitInsn(RETURN);
            methodVisitor.visitMaxs(2, 2);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "setConfigList", "(Ljava/util/List;)V", "(Ljava/util/List<Lcom/yzy/bi/entity/core/Test;>;)V", null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitFieldInsn(PUTFIELD, "com/yzy/bi/entity/core/Test", "configList", "Ljava/util/List;");
            methodVisitor.visitInsn(RETURN);
            methodVisitor.visitMaxs(2, 2);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "setStream", "(Lcom/yzy/bi/entity/core/Stream;)V", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitFieldInsn(PUTFIELD, "com/yzy/bi/entity/core/Test", "stream", "Lcom/yzy/bi/entity/core/Stream;");
            methodVisitor.visitInsn(RETURN);
            methodVisitor.visitMaxs(2, 2);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "equals", "(Ljava/lang/Object;)Z", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitVarInsn(ALOAD, 0);
            Label label0 = new Label();
            methodVisitor.visitJumpInsn(IF_ACMPNE, label0);
            methodVisitor.visitInsn(ICONST_1);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label0);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitTypeInsn(INSTANCEOF, "com/yzy/bi/entity/core/Test");
            Label label1 = new Label();
            methodVisitor.visitJumpInsn(IFNE, label1);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label1);
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitTypeInsn(CHECKCAST, "com/yzy/bi/entity/core/Test");
            methodVisitor.visitVarInsn(ASTORE, 2);
            methodVisitor.visitVarInsn(ALOAD, 2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "canEqual", "(Ljava/lang/Object;)Z", false);
            Label label2 = new Label();
            methodVisitor.visitJumpInsn(IFNE, label2);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitVarInsn(ASTORE, 3);
            methodVisitor.visitVarInsn(ALOAD, 2);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitVarInsn(ASTORE, 4);
            methodVisitor.visitVarInsn(ALOAD, 3);
            Label label3 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label3);
            methodVisitor.visitVarInsn(ALOAD, 4);
            Label label4 = new Label();
            methodVisitor.visitJumpInsn(IFNULL, label4);
            Label label5 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label5);
            methodVisitor.visitLabel(label3);
            methodVisitor.visitVarInsn(ALOAD, 3);
            methodVisitor.visitVarInsn(ALOAD, 4);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z", false);
            methodVisitor.visitJumpInsn(IFNE, label4);
            methodVisitor.visitLabel(label5);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label4);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getNo", "()Ljava/lang/String;", false);
            methodVisitor.visitVarInsn(ASTORE, 5);
            methodVisitor.visitVarInsn(ALOAD, 2);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getNo", "()Ljava/lang/String;", false);
            methodVisitor.visitVarInsn(ASTORE, 6);
            methodVisitor.visitVarInsn(ALOAD, 5);
            Label label6 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label6);
            methodVisitor.visitVarInsn(ALOAD, 6);
            Label label7 = new Label();
            methodVisitor.visitJumpInsn(IFNULL, label7);
            Label label8 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label8);
            methodVisitor.visitLabel(label6);
            methodVisitor.visitVarInsn(ALOAD, 5);
            methodVisitor.visitVarInsn(ALOAD, 6);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z", false);
            methodVisitor.visitJumpInsn(IFNE, label7);
            methodVisitor.visitLabel(label8);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label7);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getPrint", "()Ljava/lang/String;", false);
            methodVisitor.visitVarInsn(ASTORE, 7);
            methodVisitor.visitVarInsn(ALOAD, 2);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getPrint", "()Ljava/lang/String;", false);
            methodVisitor.visitVarInsn(ASTORE, 8);
            methodVisitor.visitVarInsn(ALOAD, 7);
            Label label9 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label9);
            methodVisitor.visitVarInsn(ALOAD, 8);
            Label label10 = new Label();
            methodVisitor.visitJumpInsn(IFNULL, label10);
            Label label11 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label11);
            methodVisitor.visitLabel(label9);
            methodVisitor.visitVarInsn(ALOAD, 7);
            methodVisitor.visitVarInsn(ALOAD, 8);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z", false);
            methodVisitor.visitJumpInsn(IFNE, label10);
            methodVisitor.visitLabel(label11);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label10);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getParentId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitVarInsn(ASTORE, 9);
            methodVisitor.visitVarInsn(ALOAD, 2);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getParentId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitVarInsn(ASTORE, 10);
            methodVisitor.visitVarInsn(ALOAD, 9);
            Label label12 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label12);
            methodVisitor.visitVarInsn(ALOAD, 10);
            Label label13 = new Label();
            methodVisitor.visitJumpInsn(IFNULL, label13);
            Label label14 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label14);
            methodVisitor.visitLabel(label12);
            methodVisitor.visitVarInsn(ALOAD, 9);
            methodVisitor.visitVarInsn(ALOAD, 10);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z", false);
            methodVisitor.visitJumpInsn(IFNE, label13);
            methodVisitor.visitLabel(label14);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label13);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getConfigList", "()Ljava/util/List;", false);
            methodVisitor.visitVarInsn(ASTORE, 11);
            methodVisitor.visitVarInsn(ALOAD, 2);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getConfigList", "()Ljava/util/List;", false);
            methodVisitor.visitVarInsn(ASTORE, 12);
            methodVisitor.visitVarInsn(ALOAD, 11);
            Label label15 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label15);
            methodVisitor.visitVarInsn(ALOAD, 12);
            Label label16 = new Label();
            methodVisitor.visitJumpInsn(IFNULL, label16);
            Label label17 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label17);
            methodVisitor.visitLabel(label15);
            methodVisitor.visitVarInsn(ALOAD, 11);
            methodVisitor.visitVarInsn(ALOAD, 12);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z", false);
            methodVisitor.visitJumpInsn(IFNE, label16);
            methodVisitor.visitLabel(label17);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label16);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getStream", "()Lcom/yzy/bi/entity/core/Stream;", false);
            methodVisitor.visitVarInsn(ASTORE, 13);
            methodVisitor.visitVarInsn(ALOAD, 2);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getStream", "()Lcom/yzy/bi/entity/core/Stream;", false);
            methodVisitor.visitVarInsn(ASTORE, 14);
            methodVisitor.visitVarInsn(ALOAD, 13);
            Label label18 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label18);
            methodVisitor.visitVarInsn(ALOAD, 14);
            Label label19 = new Label();
            methodVisitor.visitJumpInsn(IFNULL, label19);
            Label label20 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label20);
            methodVisitor.visitLabel(label18);
            methodVisitor.visitVarInsn(ALOAD, 13);
            methodVisitor.visitVarInsn(ALOAD, 14);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z", false);
            methodVisitor.visitJumpInsn(IFNE, label19);
            methodVisitor.visitLabel(label20);
            methodVisitor.visitInsn(ICONST_0);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitLabel(label19);
            methodVisitor.visitInsn(ICONST_1);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitMaxs(2, 15);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PROTECTED, "canEqual", "(Ljava/lang/Object;)Z", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitVarInsn(ALOAD, 1);
            methodVisitor.visitTypeInsn(INSTANCEOF, "com/yzy/bi/entity/core/Test");
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitMaxs(1, 2);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "hashCode", "()I", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitIntInsn(BIPUSH, 59);
            methodVisitor.visitVarInsn(ISTORE, 1);
            methodVisitor.visitInsn(ICONST_1);
            methodVisitor.visitVarInsn(ISTORE, 2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitVarInsn(ASTORE, 3);
            methodVisitor.visitVarInsn(ILOAD, 2);
            methodVisitor.visitIntInsn(BIPUSH, 59);
            methodVisitor.visitInsn(IMUL);
            methodVisitor.visitVarInsn(ALOAD, 3);
            Label label0 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label0);
            methodVisitor.visitIntInsn(BIPUSH, 43);
            Label label1 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label1);
            methodVisitor.visitLabel(label0);
            methodVisitor.visitVarInsn(ALOAD, 3);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "hashCode", "()I", false);
            methodVisitor.visitLabel(label1);
            methodVisitor.visitInsn(IADD);
            methodVisitor.visitVarInsn(ISTORE, 2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getNo", "()Ljava/lang/String;", false);
            methodVisitor.visitVarInsn(ASTORE, 4);
            methodVisitor.visitVarInsn(ILOAD, 2);
            methodVisitor.visitIntInsn(BIPUSH, 59);
            methodVisitor.visitInsn(IMUL);
            methodVisitor.visitVarInsn(ALOAD, 4);
            Label label2 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label2);
            methodVisitor.visitIntInsn(BIPUSH, 43);
            Label label3 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label3);
            methodVisitor.visitLabel(label2);
            methodVisitor.visitVarInsn(ALOAD, 4);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "hashCode", "()I", false);
            methodVisitor.visitLabel(label3);
            methodVisitor.visitInsn(IADD);
            methodVisitor.visitVarInsn(ISTORE, 2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getPrint", "()Ljava/lang/String;", false);
            methodVisitor.visitVarInsn(ASTORE, 5);
            methodVisitor.visitVarInsn(ILOAD, 2);
            methodVisitor.visitIntInsn(BIPUSH, 59);
            methodVisitor.visitInsn(IMUL);
            methodVisitor.visitVarInsn(ALOAD, 5);
            Label label4 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label4);
            methodVisitor.visitIntInsn(BIPUSH, 43);
            Label label5 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label5);
            methodVisitor.visitLabel(label4);
            methodVisitor.visitVarInsn(ALOAD, 5);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "hashCode", "()I", false);
            methodVisitor.visitLabel(label5);
            methodVisitor.visitInsn(IADD);
            methodVisitor.visitVarInsn(ISTORE, 2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getParentId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitVarInsn(ASTORE, 6);
            methodVisitor.visitVarInsn(ILOAD, 2);
            methodVisitor.visitIntInsn(BIPUSH, 59);
            methodVisitor.visitInsn(IMUL);
            methodVisitor.visitVarInsn(ALOAD, 6);
            Label label6 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label6);
            methodVisitor.visitIntInsn(BIPUSH, 43);
            Label label7 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label7);
            methodVisitor.visitLabel(label6);
            methodVisitor.visitVarInsn(ALOAD, 6);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "hashCode", "()I", false);
            methodVisitor.visitLabel(label7);
            methodVisitor.visitInsn(IADD);
            methodVisitor.visitVarInsn(ISTORE, 2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getConfigList", "()Ljava/util/List;", false);
            methodVisitor.visitVarInsn(ASTORE, 7);
            methodVisitor.visitVarInsn(ILOAD, 2);
            methodVisitor.visitIntInsn(BIPUSH, 59);
            methodVisitor.visitInsn(IMUL);
            methodVisitor.visitVarInsn(ALOAD, 7);
            Label label8 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label8);
            methodVisitor.visitIntInsn(BIPUSH, 43);
            Label label9 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label9);
            methodVisitor.visitLabel(label8);
            methodVisitor.visitVarInsn(ALOAD, 7);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "hashCode", "()I", false);
            methodVisitor.visitLabel(label9);
            methodVisitor.visitInsn(IADD);
            methodVisitor.visitVarInsn(ISTORE, 2);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getStream", "()Lcom/yzy/bi/entity/core/Stream;", false);
            methodVisitor.visitVarInsn(ASTORE, 8);
            methodVisitor.visitVarInsn(ILOAD, 2);
            methodVisitor.visitIntInsn(BIPUSH, 59);
            methodVisitor.visitInsn(IMUL);
            methodVisitor.visitVarInsn(ALOAD, 8);
            Label label10 = new Label();
            methodVisitor.visitJumpInsn(IFNONNULL, label10);
            methodVisitor.visitIntInsn(BIPUSH, 43);
            Label label11 = new Label();
            methodVisitor.visitJumpInsn(GOTO, label11);
            methodVisitor.visitLabel(label10);
            methodVisitor.visitVarInsn(ALOAD, 8);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "hashCode", "()I", false);
            methodVisitor.visitLabel(label11);
            methodVisitor.visitInsn(IADD);
            methodVisitor.visitVarInsn(ISTORE, 2);
            methodVisitor.visitVarInsn(ILOAD, 2);
            methodVisitor.visitInsn(IRETURN);
            methodVisitor.visitMaxs(2, 9);
            methodVisitor.visitEnd();
        }
        {
            methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "toString", "()Ljava/lang/String;", null, null);
            methodVisitor.visitCode();
            methodVisitor.visitTypeInsn(NEW, "java/lang/StringBuilder");
            methodVisitor.visitInsn(DUP);
            methodVisitor.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "()V", false);
            methodVisitor.visitLdcInsn("Test(id=");
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitLdcInsn(", no=");
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getNo", "()Ljava/lang/String;", false);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitLdcInsn(", print=");
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getPrint", "()Ljava/lang/String;", false);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitLdcInsn(", parentId=");
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getParentId", "()Ljava/lang/Integer;", false);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitLdcInsn(", configList=");
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getConfigList", "()Ljava/util/List;", false);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitLdcInsn(", stream=");
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitVarInsn(ALOAD, 0);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "com/yzy/bi/entity/core/Test", "getStream", "()Lcom/yzy/bi/entity/core/Stream;", false);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitLdcInsn(")");
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
            methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
            methodVisitor.visitInsn(ARETURN);
            methodVisitor.visitMaxs(2, 1);
            methodVisitor.visitEnd();
        }
        classWriter.visitEnd();

        return classWriter.toByteArray();
    }


    public void setter(ClassWriter classWriter,FlyField field){
        int methodAccess = ACC_PUBLIC;
        String[] exceptions = null;
        String fieldName = field.getName();
        String methodName = "set"+ fieldName.substring(0,1).toUpperCase() + fieldName.substring(1);
        MethodVisitor methodVisitor = classWriter.visitMethod(methodAccess, methodName, "(Ljava/util/List;)V", "(Ljava/util/List<Lcom/yzy/bi/entity/core/Test;>;)V", exceptions);
        methodVisitor.visitCode();
        methodVisitor.visitVarInsn(ALOAD, 0);
        methodVisitor.visitVarInsn(ALOAD, 1);
        methodVisitor.visitFieldInsn(PUTFIELD, "com/yzy/bi/entity/core/Test", fieldName, "Ljava/util/List;");
        methodVisitor.visitInsn(RETURN);
        methodVisitor.visitMaxs(2, 2);
        methodVisitor.visitEnd();
    }

    public void getter(ClassWriter classWriter,FlyField field){
        int methodAccess = ACC_PUBLIC;
        String[] exceptions = null;
        String fieldName = field.getName();
        String methodName = "get"+ fieldName.substring(0,1).toUpperCase() + fieldName.substring(1);
        MethodVisitor methodVisitor = classWriter.visitMethod(methodAccess, methodName, "()Ljava/util/List;", "()Ljava/util/List<Lcom/yzy/bi/entity/core/Test;>;", exceptions);
        methodVisitor.visitCode();
        methodVisitor.visitVarInsn(ALOAD, 0);
        methodVisitor.visitFieldInsn(GETFIELD, "com/yzy/bi/entity/core/Test", fieldName, "Ljava/util/List;");
        methodVisitor.visitInsn(ARETURN);
        methodVisitor.visitMaxs(1, 1);
        methodVisitor.visitEnd();
    }
}

